package population;
import java.util.HashMap;
import java.util.List;

import multiarray.MultiArray;

import trees.AttributeNode;

import coalition.CoalitionWithInfoInterface;
import coalition.scoring.AgentAltruism;



public interface PopulationInterface {

	//static factory pattern
	//public PopulationInterface getNewPopulationInterface(int[] dimensionSizes);
	//i.e. PopulationInterface population = Population.getNewPopulationInterface(int[] dimensionSizes);
	
	//add an agent to this cross sectional group
	public void registerAgentInSector(int[] sectorIndices);

	//get the population size of a cross section modulated by its mean income/power
	public float getSectorModulatedPopulationSize(int[] sectorIndices);
	
	//get the total size of the population in all cross sections, modulated
	//by income in each cross section
	public float getTotalModulatedSize();
	
	//set the maximum number of categories that can participate in an ascriptive attribute disjunction
	public void setMaximumDisjunctiveSize(int size, boolean negationsAllowed);
	
	//set the maximum number of categories that can participate in an ascriptive attribute disjunction
	public void setMaximumDisjunctiveSize(int size);	
	
	//set the population of a cross section of the population
	public void setSectorPopulation(int[] sectorIndices, int populationSize);

	//set the mean income/power within a cross section of the population 
	public void setSectorPower(int[] sectorIndices, float power);

	//get the population size within a cross section 
	public int getSectorPopulationSize(int[] sectorIndices);

	//get the mean power/income within a cross section
	public float getSectorPower(int[] sectorIndices);

	//get the winning coalition
	public CoalitionWithInfoInterface getWinningCoalition();
	
	public CoalitionWithInfoInterface getWinningCoalitionMinusSectors(List<int[]> excludedSectors);
	
	public CoalitionWithInfoInterface createCustomCoalition(List<int[]> sectors);
	
	//get the preferred feasible coalition for a given cross section
	public CoalitionWithInfoInterface getPreferredCoalition(int[] querySectorIndices);
	
	public void setAltruismArrays(List<AgentAltruism> altruismArrays);
	
	public void setAltruismArraysGlobally(MultiArray<MultiArray<Float>> altruismArrays);
	
	public void setAttributeAndCategoryNames(
			int index,					//the attribute index
			String attributeName, 		//the name of the attribute class, ie religion or region
			String[] categoryNames		//the names of the categories
			);
	
	public List<String> getCategoryNamesForAttribute(int index);
	
	public String getAttributeName(int index);

	public void setHierarchicalStructureForAtttribute(
			int attributeIndex,					//the index of the attribute
			HashMap<Integer, Integer> links, 	//a hashmap of links from children to parents
			HashMap<Integer, String> names,		//the names of the attributes by category index
			List<Integer> roots					//the indices of the roots of the hierarchy
			//List<Integer> leafs				//the indices of the leafs of the hierarchy
												//are always the first ones
	);
	
	public void setHierarchicalStructureForAtttribute(int index, String attributeFileBlock);
	
	public List<AttributeNode> getAttributeHierarchy(int index);
	
	public List<CoalitionWithInfoInterface> getRecursivelyResidualCoalitions();
}